package com.czkt.utils;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
public class PageUtils<T> extends Page {
    private List<T> content;

    private long totalElements;
    private long number;
    private long totalPages;

    public List<T> getContent() {
        return getRecords();
    }

    public void setContent(List<T> content) {
        this.content = content;
    }

    public long getTotalElements() {
        return getTotal();
    }

    public void setTotalElements(long totalElements) {
        this.totalElements = totalElements;
    }

    public long getNumber() {
        return getCurrent()-1;
    }

    public void setNumber(long number) {
        this.number = number;
    }

    public long getTotalPages() {
        return getPages();
    }

    public void setTotalPages(long totalPages) {
        this.totalPages = totalPages;
    }
}
